#pragma once
#include "BSplineSurface.h"
#include "stdafx.h"
#include "MillingTool.h"
#include "MillingMachine3C.h"
#include "ConfigurationState.h"
#include "PathLineGenerator.h"
#include <vector>
#include <map>
#include "Point3D.h"
using namespace std;


class BSplinePatchPathGenerator
{
	//MY_DATATYPE * material;
	/*
	material, mapa najpierw po y materialu, potem po x, sortowanie rosnaco
	*/
	MaterialType * material;
	//bool * toolVisited;
	PathLineGenerator * pathLineSweepGenerator;
	UINT width;
	UINT height;
	UINT depth;
	int samplesPerMaterialX;
	int samplesPerMaterialY;
	Point3D pathMiddle;
	int getHashIndex(Point3D & point);
public:
	BSplinePatchPathGenerator(MillingMachine3C * machine,int samplesPerMaterialX,int samplesPerMaterialY,Point3D & pathMiddle);
	~BSplinePatchPathGenerator(void);
	void GeneratePath(BSplineSurface * surface,MillingTool * tool);
	void saveToFile(const char * fileName);
	void generateConfigurationStates();
	vector<ConfigurationState*> * states;
};

